{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[167.71092217]\n",
      "124.29300196206685\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYsAAAEJCAYAAABlmAtYAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAgAElEQVR4nO3de5gcVbnv8e+PJMCAyCDECEkwXLLDAeQ6QhT0KCA3kcRbwKMSEM3RjYKiCPi4uenZiqgo4mbvAEqiCAa5RTeCMYh4VNAkYMJFNCKYDJcETMIlUUJ49x+1Ouk0M9M16a7umszv8zz9dNWq1b3eKZi8U2vVWqWIwMzMrC+btDsAMzMrPycLMzOry8nCzMzqcrIwM7O6nCzMzKwuJwszM6ursGQh6TuSlki6r6rsVZJmSfpzet8mlUvSJZIWSpovab+qz0xO9f8saXJR8ZqZWe+KvLK4CjiypuwsYHZEjAVmp32Ao4Cx6TUFuAyy5AKcCxwIHACcW0kwZmbWOkOL+uKIuFPSmJriCcBb0vY04A7gzFQ+PbIZgndJ6pS0fao7KyL+DiBpFlkCuqavtrfbbrsYM6a2aTMz68vcuXOfiojhPR0rLFn0YkREPJ62nwBGpO2RwKKqeotTWW/lfRozZgxz5sxpPFozs0FE0qO9HWvbAHe6imjaWiOSpkiaI2nO0qVLm/W1ZmZG65PFk6l7ifS+JJV3A6Or6o1KZb2Vv0xETI2IrojoGj68x6soMzPbQK1OFjOByh1Nk4Gbq8pPSHdFjQdWpO6q24DDJW2TBrYPT2VmZtZChY1ZSLqGbIB6O0mLye5q+jIwQ9LJwKPApFT9FuBoYCGwEjgJICL+LukLwO9TvQsqg91mZtY62hiXKO/q6goPcJuZ9Y+kuRHR1dMxz+A2M7O6nCzM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JmA3/ox89kJeNVZ80GuJSg1kTEi5LeAFyWnphn1jS+sjAb+HYEZqSrkhdYd0eYWdP4ysLMzOryALeZmdXlZGFmZnU5WZiZWV1OFmZmVpeThZmZ1eVkYWZmdf0P9ArGWog+PyUAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "from sklearn.linear_model import LinearRegression\n",
    "\n",
    "x_train = np.array([1.7, 1.5, 1.3, 5, 1.3, 2.2])\n",
    "\n",
    "y_train = np.array([368, 340, 376, 954, 332, 556])\n",
    "\n",
    "#使用默认的值进行初始化\n",
    "#参差平方\n",
    "lr = LinearRegression()\n",
    "#在scikit-learn中，训练数据x是二维数组，例子中是单维特征，需要变成二维数组\n",
    "x_train = x_train.reshape(-1, 1)\n",
    "#训练模型参数\n",
    "lr.fit(x_train, y_train)\n",
    "\n",
    "plt.scatter(x_train, y_train, label=\"Train Simples\")\n",
    "\n",
    "\n",
    "plt.xlabel(\"online advertising dollars\")\n",
    "plt.ylabel(\"monthly e-commenerce sales\")\n",
    "#预测值\n",
    "y_predict = lr.predict(x_train)\n",
    "plt.scatter(x_train, y_predict, label=\"predict simples\")\n",
    "#系数\n",
    "print(lr.coef_)\n",
    "#截距项\n",
    "print(lr.intercept_)\n",
    "plt.show()\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
